-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the editor file import UI to support markdown tiddlers #8486
Conversation
Confirmed: saqimtiaz has already signed the Contributor License Agreement (see contributing.md) |
In my opinion, one tiddler shouldn't handle more than one types of links. This is because of these reasons: Different types of links needs to be handled differently. For example, markdown internal links requires escaping characters like I think a better solution is to abandon the For the code duplication problem,since the core logic is the same, I think we can create a template and require the handler to provide essential information (like the link template, characters to escape) to solve it. |
This isn't a possibility due to backwards compatibility constraints and the fact that showing an affordance to import something and having nothing happen when you drop a file would be very misleading and would be construed as a bug. Also, it is a useful feature to be able to turn off the ability to import into the editor as well.
I have considered a similar solution where we lookup the template to use in a given tiddler type and if it does not exist, fall back to wikitext. This would allow plugins to provide the templates to use for different tiddler types. However, given that there is unlikely to be another plain text format that needs to be supported, this does feel like an unnecessary amount of complexity.
Escaping characters for markdown can be easily incorporated into this PR. |
@Leilei332 I have updated the code to URI encode tiddler titles for markdown tiddlers, which the Markdown plugin documentation states is an alternative to escaping characters:
|
In my opinion, I preferred escaped characters to URI encoded characters, since they don't make non-ASCII characters unreadable (as is described in #8402). |
Updated to use character escaping instead of URI encoding of tiddler titles used in image syntax in markdown tiddlers. |
f1ab613
to
5b74a5a
Compare
5b74a5a
to
19c1224
Compare
Hi @saqimtiaz is this ready to come out of draft as suggested by @Leilei332 over in #8525 (comment)? |
@Jermolene this should be good to go. I prefer this implementation over the one in #8525 as explained here. |
Thanks @saqimtiaz |
This PR updates the import UI in the editor that is triggered by drag and drop to be reusable in x-markdown tiddlers.
$:/config/Editor/EnableImportFilter
which defines whether importing in the editor is supported for that tiddler typeThis PR explores an alternative to #8463 to reduce code duplication and closes #8388